package com.foodchain.controller;

import com.foodchain.entity.Banner;
import com.foodchain.service.BannerService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName banner图
 * @Description TODO
 * @Author duyuanyuan
 * @Date 2019/3/19 13:51
 * @Version 1.0
 **/
@Controller
@RequestMapping("/banner")
public class BannerController extends BaseController {

    @Resource
    private BannerService bannerService;

    /*
     * 功能描述:查询banner列表
     * @param:  * @param
     * @return: java.lang.String
     * @auther: duyuanyuan
     * @date: 2019/3/27 17:27
     */
    @RequestMapping("/list")
    @ResponseBody
    public String list(){
        List<Banner> banner = bannerService.findAll();
        return JsonCode(0,"success",banner);
    }
}
